<template>
    <div class="addProject business-workAdd">
        <div class="addForm zll-form">
			<el-form :model="addForm" :rules="rules" ref="addForm" class="demo-ruleForm">
				<el-row :gutter="40">
					<el-col :span="8">
						<el-form-item class="formList" prop="" label="日期：">
							<el-input clearable class="input_right"  v-model="addForm.dutyDay" :disabled="type == 'see'" ></el-input>
						</el-form-item>
                    </el-col>
					<el-col :span="8">
						<el-form-item class="formList" prop="" label="今日出勤：">
							<el-input clearable class="input_right"  v-model="addForm.totalUserCount" :disabled="type == 'see'" ></el-input>
						</el-form-item>
                    </el-col>
					<el-col :span="8">
						<el-form-item class="formList" prop="" label="核定人：">
							<el-input clearable class="input_right"  v-model="addForm.checkUserName+' '+ addForm.checkTime" :disabled="type == 'see'" ></el-input>
						</el-form-item>
                    </el-col>
                </el-row>
                <div style="margin-top: 10px" v-loading="tableLoading">
                    <div  class="tableList" style="margin-top: 0 !important;">
                        <table border="1">
                            <tr>
                                <th>序号</th>
                                <th>部门</th>
                                <th>岗位</th>
                                <th>姓名</th>
                                <th>班次</th>
                                <th>出勤</th>
                                <th>个人薪资</th>
                                <th>补全</th>
                                <th>计件日薪</th>
                            </tr>
                            <tr class="add_Table" v-for="(item,index) in tableList" :key="index">
								<td>
									{{index+1}}
								</td>
                                <td>
                                   {{item.deptName}}
                                </td>
								<td>
									{{item.roleName}}
								</td>
								<td>
									{{item.userName}}
								</td>
								<td>
									{{item.whiteDay}}
								</td>
								<td>
									{{item.kaoQIn}}
								</td>
								<td>
									{{item.xinzi}}
								</td>
								<td>
									{{item.buQuan}}
								</td>
								<td>
									{{item.jijianXinZi}}
								</td>
							</tr>
                        </table>
                    </div>
                </div>
            </el-form>
        </div>
    </div>
</template>
<script>
export default {
    props: ['type','editData'],
    data(){
        return {
        	tableLoading:false,
			tableList:[],
            addForm: {
				id:'',
				dutyDay:'',
				totalUserCount:'',
				checkUserName:'',
				checkTime:'',
            },
            rules: {

            },
        }
    },
    methods: {

		getAllBgTasksByBgId() {
			let self = this;
			self.tableLoading = true;
			self.tableList = [];
			self.$http({
				url: "/jinl/bgTask/getAllBgTasksByBgId",
				method: "post",
				params: {bgId:self.addForm.id}
			}).then(resp => {
				self.tableLoading = false;
				if (resp.success) {
					self.tableList = resp.result;
				}
			});
		},
    },
	watch:{
		editData(val) {
			this.addForm = Object.assign({},val);
			this.getAllBgTasksByBgId();
		},
	},
    mounted(){
        
    },
    components: {
    }
}
</script>
<style lang="scss" scoped>
    @import "@/style/dialog.scss";
    .business-workAdd.addProject {
        position: relative;padding-bottom: 40px;min-height: 100%;
        .con_p {
            display: flex;justify-content: space-between;margin-top: 20px;margin-bottom: 10px;
            .tab_list {
                display: flex;
                li {
                    width: 140px;line-height: 32px;border-bottom: 1px solid #fff;
                    text-align: center;cursor: pointer;color:#918d8d;
                    &.active {
                        color: #2196f3;font-size: 14px;border-bottom: 1px solid #2196f3;
                    }
                }
            }
        }
        .report_part {
            height: 400px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            .noData {
                text-align: center;color: #918d8d;line-height: 40px;
            }
            .zll-botton {
                width: 120px;
            }
        }
        .bottom_nav {
            display: flex;justify-content: center;position: absolute;
            width: 100%;
            bottom: 20px;z-index: 1111;
            .zll-botton {
                margin: 0 20px;
            }
        }
        .ban_ci {
            display: flex;
            li {
                width: 130px;
                background: #ddd;
                color: #918d8d;
                line-height: 30px;
                height: 30px;
                text-align: center;
                margin-right: 5px;
                cursor: pointer;
                display: flex;align-items: center;justify-content: center;

                &.active {
                    background: #2196f3;
                    color: #fff;
                }
                img {
                    width: 20px;height: 20px;margin-right: 5px;
                }
            }
        }
        .formList {
            margin-bottom: 0px;
            height: 32px;
        }
        .tableList {
            margin-bottom: 20px;
            table {
                tr {
                    background: #fff !important;
                    td {
                        padding: 1px 3px;
                    }
                }
            }
        }
    }
</style>